# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=netreconn
_pkgname=netrecon
pkgver=1.78
pkgrel=5
groups=('blackarch' 'blackarch-networking' 'blackarch-recon' 'blackarch-scanner')
pkgdesc='A collection of network scan/recon tools that are relatively small compared to their larger cousins.'
arch=('x86_64' 'aarch64')
url='http://packetstormsecurity.com/files/86076/NetReconn-Scanning-Tool-Collection-1.76.html'
license=('GPL2')
depends=('perl' 'glibc' 'libpcap')
source=("https://dl.packetstormsecurity.net/UNIX/utilities/netrecon-$pkgver.tgz")
sha512sums=('846e35fe18ad5aa6693544573ad97bc38e05ce6674facb11d98d4f25f1c51e946c2cf6605afc119d2cda8c2ef9fab4f8ab55952c7c203227273554b873d1bc2f')

prepare() {
  cd "$_pkgname-$pkgver"

  sed -i 's|/usr/local/share/man/man1|/usr/share/man/man1|' Makefile
  sed -i 's|/usr/local/bin|/usr/bin|' Makefile
  #sed -i 's|/usr/local/bin|/usr/bin|' ntrace.pl
  #sed -i 's|/var/tmp|/tmp|' ntrace.pl
  #sed -i 's|/usr/local/bin|/usr/bin|' nlist.sh
}

build() {
  cd "$_pkgname-$pkgver"

  make linux
}

package() {
  cd "$_pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/man/man1/"

  install -Dm 755 netrecon "$pkgdir/usr/bin/$pkgname"

  for i in *.1 ; do
    install -m 644 $i "$pkgdir/usr/share/man/man1/$i"
  done

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README ChangeLog TODO
  install -Dm 644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}

